function RunScene(scene)
    if cc.Director:getInstance():getRunningScene() then
        print("replace scene")
        cc.Director:getInstance():popToRootScene();
        cc.Director:getInstance():replaceScene(scene)
    else
        print("run scene")
        cc.Director:getInstance():runWithScene(scene)
    end
end

function ReplaceScene(scene)
    cc.Director:getInstance():replaceScene(scene) 
end

function PushScene(scene)
    print("push scene", scene)
    cc.Director:getInstance():pushScene(scene) 
end

function PopScene()
    print("pop scene")
    cc.Director:getInstance():popScene();
end

function PopAllScene()
    cc.Director:getInstance():popToRootScene();
end

function PauseScene(scene)
    cc.Director:getInstance():pause();
end

function ResumeScene(scene)
    cc.Director:getInstance():resume();
end

function EndScene(scene)
    cc.Director:getInstance():endToLua();
end



